import { InfoCircleOutlined } from '@ant-design/icons-vue'

/** 文件类型组件显示 */
export function FileTypeComponentsRender(path: string) {
    const extension = path?.split('.').pop()?.toLowerCase();
    if (['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(extension as string)) {
        return <a-image width={50} isAImage src={path} />
    } else if (['mp4', 'avi', 'mkv', 'wmv', 'flv', 'mov', 'webm'].includes(extension as string)) {
        return <video style="width: 200px; height:130px; object-fit: cover" controls preload="none">
            <source src={path} type="video/mp4" />
            您的浏览器不支持视频标签。
        </video>
    } else {
        return path
    }
}
/**
 * 提示文案
 * @param text 提示文本
 * @returns 
 */
export function tipCopywritingRender(text: string) {
    return <div style="color:#666;margin:10px 0;    text-align: left;">
        <InfoCircleOutlined /> {text}
    </div>
}